/*
 * Simplified Chinese translation
 * By DavidHu
 * 09 April 2007
 */

Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">Loading...</div>';

if(Ext.View){
   Ext.View.prototype.emptyText = "";
}

if(Ext.grid.GridPanel){
   Ext.grid.GridPanel.prototype.ddText = "{0} selected row";
}

if(Ext.TabPanelItem){
   Ext.TabPanelItem.prototype.closeText = "Close";
}

if(Ext.form.Field){
   Ext.form.Field.prototype.invalidText = "Invalid Input";
}

Date.monthNames = [
  "January",
  "February",
  "March",
  "April",
  "May",
  "June",
  "July",
  "August",
  "September",
  "October",
  "November",
  "December"
];

Date.dayNames = [
  "Sunday",
  "Monday",
  "Tuesday",
  "Wednesday",
  "Thursday",
  "Friday",
  "Saturday"
];

if(Ext.MessageBox){
   Ext.MessageBox.buttonText = {
      ok     : "OK",
      cancel : "Cancel",
      yes    : "Yes",
      no     : "No"
   };
}

if(Ext.util.Format){
   Ext.util.Format.date = function(v, format){
      if(!v) return "";
      if(!(v instanceof Date)) v = new Date(Date.parse(v));
      return v.dateFormat(format || "m/d/Y");
   };
}

if(Ext.DatePicker){
   Ext.apply(Ext.DatePicker.prototype, {
      todayText         : "Today",
      minText           : "This date is before the minimum date",
      maxText           : "This date is after the maximum date",
      disabledDaysText  : "",
      disabledDatesText : "",
      monthNames        : Date.monthNames,
      dayNames          : Date.dayNames,
      nextText          : 'Next Month (Control+Right)',
      prevText          : 'Previous Month (Control+Left)',
      monthYearText     : 'Choose a month (Control+Up/Down to move years)',
      todayTip          : "{0} (Spacebar)",
      format            : "m/d/y",
      okText            : "&#160;OK&#160;",
      cancelText        : "Cancel"
   });
}

if(Ext.PagingToolbar){
   Ext.apply(Ext.PagingToolbar.prototype, {
      beforePageText : "Page",
      afterPageText  : "of {0}",
      firstText      : "First Page",
      prevText       : "Previous Page",
      nextText       : "Next Page",
      lastText       : "Last Page",
      refreshText    : "Refresh",
      displayMsg     : "Displaying {0} - {1} of {2}",
      emptyMsg       : 'No data to display'
   });
}

if(Ext.form.TextField){
   Ext.apply(Ext.form.TextField.prototype, {
      minLengthText : "The minimum length for this field is {0}",
      maxLengthText : "The maximum length for this field is {0}",
      blankText     : "This field is required",
      regexText     : "",
      emptyText     : null
   });
}

if(Ext.form.NumberField){
   Ext.apply(Ext.form.NumberField.prototype, {
      minText : "The minimum value for this field is {0}",
      maxText : "The maximum value for this field is {0}",
      nanText : "{0} is not a valid number"
   });
}

if(Ext.form.DateField){
   Ext.apply(Ext.form.DateField.prototype, {
      disabledDaysText  : "Disabled",
      disabledDatesText : "Disabled",
      minText           : "The date in this field must be after {0}",
      maxText           : "The date in this field must be before {0}",
      invalidText       : "{0} is not a valid date - it must be in the format {1}",
      format            : "m/d/y"
   });
}

if(Ext.form.ComboBox){
   Ext.apply(Ext.form.ComboBox.prototype, {
      loadingText       : "Loading...",
      valueNotFoundText : undefined
   });
}

if(Ext.form.VTypes){
   Ext.apply(Ext.form.VTypes, {
      emailText    : 'This field should be an e-mail address in the format "user@example.com"',
      urlText      : 'This field should be a URL in the format "http:/'+'/www.example.com"',
      alphaText    : 'This field should only contain letters and _',
      alphanumText : 'This field should only contain letters, numbers and _'
   });
}

if(Ext.grid.GridView){
   Ext.apply(Ext.grid.GridView.prototype, {
      sortAscText  : "Sort Ascending",
      sortDescText : "Sort Descending",
      lockText     : "Lock Column",
      unlockText   : "Unlock Column",
      columnsText  : "Columns"
   });
}

if(Ext.grid.PropertyColumnModel){
   Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
      nameText   : "Name",
      valueText  : "Value",
      dateFormat : "m/j/Y"
   });
}

if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){
   Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, {
      splitTip            : "Drag to resize.",
      collapsibleSplitTip : "Drag to resize. Double click to hide."
   });
}

////
if(Ext.form.RadioGroup){
   Ext.apply(Ext.form.RadioGroup.prototype, {
      blankText : "You must select one item in this group"
   });
}

Ext.langs = {
   loading:'Loading...'
   ,processing:'Processing...'
   ,error:'Error'
   ,connectErrorMsg:'Server Error!'
   ,dataLoadingError:'Wrong Data!'
   ,topCategory:'Top Category'
   ,confirm:'Comfirm'
   ,cancel:'Cancel'
   ,success:'Success'
   ,failure:'Failure'
   ,save:'Save'
   ,chooseCategory:'Choose Category!'
   ,chooseFile:'Choose File'
   ,pleseChoose:'Please Choose...'
   ,navCategory:'Category Nav'
   ,allCategory:'All Category'
   ,submit:'Submit'
   ,window:'Window'
   ,noData:'No Data'
   ,collapseAll:'Collapse'
   ,expandAll:'Expand'
   ,total:'Total'
   ,loadTimeout:'Time Out!'
   ,showColumns:'Show Additional Columns'
   ,hideColumns:'Hide Additional Columns'
   ,show:'Show'
   ,pageSize:'Rows/Page'
   ,from:'From'
   ,to:'To'
   ,wrongFileFormat:'Wrong File Type.'
   ,wait:'Wait'
   ,rowIsFilled:'Row is empty!'
   ,noItemSeleced:'Nothing Selected'
   ,confirmDoAction:'Confirm'
   ,passwordNotMatch:'Password Not Match'
   ,tip:'Tips'
   ,time:'Time'
   ,handler:'Handler'
   ,sortSave:'Save Sort'
   ,select:'Select...'
   ,radius:'Radius'
   ,all:'All'
   ,nicLang: {
      'bold' : 'Bold'
      ,'italic' : 'Italic'
      ,'underline' : 'Underline'
      ,'left' : 'Left Align'
      ,'code' : 'HTML Code'
      ,'center' : 'Center Align'
      ,'right' : 'Right Align'
      ,'justify' : 'Justify Align'
      ,'ol' : 'Insert Ordered List'
      ,'ul' :  'Insert Unordered List'
      ,'subscript' : 'Subscript'
      ,'superscript' : 'Superscript'
      ,'strikethrough' : 'Strike Through'
      ,'removeformat' : 'Remove Formatting'
      ,'indent' : 'Indent Text'
      ,'outdent' : 'Remove Indent'
      ,'hr' : 'Horizontal Rule'
      ,'image':'Insert Image'
      ,'save':'Save'
      ,'submit':'Submit'
      ,'uploadImage':'Upload Image'
      ,'uploadFile':'Upload File'
      ,'uploadFailed':'Upload Image Failured'
      ,'uploadImageTypeLimit':'png & jpg File Only'
      ,'uploadImageSizeLimit':'File size shold less than 1M'
      ,'uploadFileFailed':'Upload File Failured'
      ,'uploadFileTypeLimit':'XXX File Only'
      ,'uploading' : 'Uploading...'
      ,'img':{
         'title':'Add Image'
         ,'url':'Address'
         ,'alt':'Alt Text'
         ,'align':'Align'
         ,'default':'Default'
         ,'left':'Align Left'
         ,'right':'Align Right'
         ,'wrongUrl':'Wrong Image URL'
      }
      ,'forecolor':'Text Color'
      ,'bgcolor':'Background Color'
      ,'fontSize':'FontSize'
      ,'fontFamily':'FontFamily'
      ,'fontFormat':'FontFormat'
      ,'sel':{
         'fontFamily' : {
               'SimSun'             : 'SimSun',
               'SimHei'             : 'SimHei',
               'FangSong_GB2312'    : 'FangSong_GB2312',
               'KaiTi_GB2312'       : 'KaiTi_GB2312',
               'NSimSun'            : 'NSimSun',
               'Arial'              : 'Arial',
               'Arial Black'        : 'Arial Black',
               'Times New Roman'    : 'Times New Roman',
               'Courier New'        : 'Courier New',
               'Tahoma'             : 'Tahoma',
               'Verdana'            : 'Verdana'
           }
      }
      ,'link':'Add Link'
      ,'unlink':'Remove Link'
      ,'links' : {
         'tit':'Add/Edit Link'
         ,'url':'Link'
         ,'title':'Title'
         ,'target':'Target'
         ,'error':'Wrong URL Format'
         ,'currentWindow':'Current Window'
         ,'newWindow':'New Window'
      }
      ,'pre':'Code'
      ,'p':'Photograph'
      ,'h1':'Heading 1'
      ,'h2':'Heading 2'
      ,'h3':'Heading 3'
      ,'h4':'Heading 4'
   }
}